//封装存储数据

export const KEY = "getdata";

export var valueObj = {goodsid:0,count:0}


//增加数据
export function setItme(value){
    var jsonString = localStorage.getItem(KEY);

     jsonString = jsonString || "[]";

    var arr =  JSON.parse(jsonString);

    arr.push(value);

    localStorage.setItem(KEY,JSON.stringify(arr));
}

//获取数据
export function getItme(value){

    var jsonString = localStorage.getItem(KEY);

    jsonString = jsonString || "[]";

    return JSON.parse(jsonString);
}


// 删除数据